Skip to main content

Replace Picture

AutomatR.Word.Activities.ReplacePicture

The "Replace Picture" activity in AutomatR is part of the Word activities package, allowing you to replace all occurrences of a picture in a Word document with another specified picture. This activity is particularly useful for dynamically updating images in Word documents during automation workflows.

Properties

NameDescription
Input
Find Picture With Alt TextSpecifies the alt text of the picture you want to replace. String variables containing the alt text to identify the picture.
Replace With PictureSpecifies the path of the image file to replace the identified picture. Only accepts image files. String variables containing the file path.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. Enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Replace Picture" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
HeightProvides the desired height for the inserted picture. Integer variables containing the height value.
WidthProvides the desired width for the inserted picture. Integer variables containing the width value.
Output
Replace With Picture CountOutputs the count of pictures replaced with the specified alt text. Integer variables to store the count.

How to use:

  1. Drag and drop the "Replace Picture" activity onto the workflow.
  2. Configure the properties by specifying the alt text of the picture to be replaced, the image file path for replacement, and optional settings such as delay, height, and width.
  3. Execute the workflow to replace all occurrences of the specified alt text with the provided image.

Example:

Consider an example where the "Replace Picture" activity is used to replace all occurrences of a picture with alt text "CompanyLogo" in a Word document:

Replace Picture:
Find Picture With Alt Text: "CompanyLogo"
Replace With Picture: "C:\Images\NewLogo.png"
Height: 100
Width: 200
Replace With Picture Count: replacedPictureCount

In this example, the activity searches for all pictures with alt text "CompanyLogo" in the Word document, replaces them with the image located at "C:\Images\NewLogo.png", and sets the count of replaced pictures in the variable "replacedPictureCount" for further use in the workflow.